Landing site for Kork & Krone (#11) #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Landing page for Kork & Krone
Refs #11
First version of the front page, which explains what the site is and leads the user into search.
Frontend only. All data is sample data (
features/landing/api/mockLanding.ts) until the backend is ready.Screenshots
What's added
The front page, top to bottom
/sok?type=….Shared foundation for reuse
styles/tokens.css: wine red and cork beige, a pastel colour per wine type, and dark mode.components/ui:WineCard,SearchForm,Bottle,DiceFaceandChip. The wine card and search field are built to be reused on the search page.components/layout:AppLayout,HeaderandFooter.basenametaken from Vite'sbase:/,/sok,/vin/:id,/mineand 404. Pages are loaded withReact.lazy.buildSearchUrlandparseSearchParamsinlib/searchParams.tsare the contract between the front page and the search page:?q=&type=&land=&drue=&mat=&sort=.Setup
base: '/project2/'invite.config.ts.index.html:lang="nb", description,color-schemeand a new title.Removed
App.tsxwith the PostgreSQL greeting, and its test. It was the only check that the backend and database respond. The/api/helloproxy is still invite.config.ts.src/index.css, replaced bystyles/global.css.Testing
Run it yourself:
Accessibility
header,nav,main,footer) and one h1 per page.role="search".aria-pressedbutton with the wine name in its accessible name.role="alert"and a «Prøv igjen» (Try again) button.prefers-reduced-motionis respected.Sustainability
LANDING_QUERY).prefers-color-scheme.Dependencies
react-router(runtime) and test packages (dev).npm audit fix: updated, among others, Vite to a version without known vulnerabilities.npm installafter pulling this branch.Backend wiring (later)
useLandingDatawithuseQuery(LANDING_QUERY). The code is in a comment in the file. The return shape is the same, so the components don't need to change.LANDING_QUERYinfeatures/landing/api/landingQuery.tsis a proposal the backend can implement against.useWishliststores data in the browser for now. It will be replaced by thesetListStatusmutation.For whoever builds the search page
features/search/SearchPage.tsxis only a placeholder. Replace it.parseSearchParams, so the front page and the search page use the same parameters.WineCardandSearchFormcan be reused directly.AI used – for what, and how was it verified?
Tool: Claude.
Used for: generating components, design tokens, tests and setup, and guidance on git and splitting the work into commits.
Changed after generation:
react-refresh/only-export-components).useLandingDataset state synchronously inside an effect (react-hooks/set-state-in-effect).<output>, which has an implicitrole="status"and clashed with the page's live region.Verified with: lint,
tsc -b, Vitest, Playwright and manual testing. Each commit was run and checked before it was added.How to review
Go through it commit by commit. Each commit builds and has its own tests:
chore(frontend): test setupchore(deps): npm audit fixfeat(ui): design tokensfeat(lib): URL builder and formattingfeat(ui): UI components and hooksfeat(layout): header, footer and focus handlingfix(test): test helper without a status rolefeat(landing): the front page with sample datafeat(app): routes and cleanuptest(e2e): PlaywrightChecklist